import avail.*; import org.jdom.*; import org.jdom.input.SAXBuilder; import org.jdom.output.XMLOutputter; /** * Basic JDOM Example * Outputs any local XML file specified on the command line * Example usage: * java jdom1 document.xml */ public class jdom1 { // Download and Output XML File public void process (String fileName) { try { // Use SAXBuilder SAXBuilder builder = new SAXBuilder(); Document doc = builder.build(new File(fileName)); // Use XMLOutputter XMLOutputter out = new XMLOutputter (); out.output (doc, System.out); } catch (Exception e) { e.printStackTrace(); } } public static void main (String[] args) { System.out.println ("JDOM1 Example"); System.out.println ("Downloading file: "+args[0]); jdom1 app = new jdom1(); app.process(args[0]); } }